package com.jml.jdk8.方法引用;

import com.jml.jdk8.base.Student;

/**
 * @Author: J
 * @DATE: 2022-04-15 15:51
 */
public class StudentComparator {

    public int compareScore(Student student) {
        return 1;
    }

    //按照分数比较
    public int compareStudentByScore(Student student1, Student student2) {
        return student1.getScore() - student2.getScore();
    }

    //按照名字比较
    public int compareStudentByName(Student student1, Student student2) {
        return student1.getName().compareToIgnoreCase(student2.getName());
    }
}
